package com.example.demo.async;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author: cj
 * @create: 15-08-01 15:40:57
 */
@Service
@Slf4j
public class MyAsyncService {
    @Async
    public void test01() {
        try {
            log.info ( Thread.currentThread ().getName () + " test01, 执行开始." );
            Thread.sleep ( 2000 );
            log.info ( Thread.currentThread ().getName () + " test01, 执行结束" );
        } catch (InterruptedException e) {
            log.error ( "sleep error." );
        }
    }
}
